<%@page import="com.core.utils.LocalizableString"%>
<%@page import="com.core.ui.controller.ActionBarController"%>
<%@page import="com.entities.userrole.actionscript.ActionScriptParserRoleOpen"%>
<%@page import="com.entities.userrole.list.UserRoleListController"%>
<%@page import="com.core.managers.SessionManager"%>
<%@page import="com.core.utils.GlobalConstants"%>
<%@taglib prefix="sorokina" uri="/WEB-INF/Sorokina.tld"%>
<%
	LocalizableString localizableString = LocalizableString.sharedInstance();
	String confirm = LocalizableString.sharedInstance().localizable("tabsheet.roles.roleslist.confirm.delete");
%>
<script type="text/javascript">
function deleteRole(roleId){
    var confirmResult = confirm("<%=confirm%>");
    if (confirmResult){

        jQuery.post('<%=GlobalConstants.SERVLET_ROLEDELETE%>',
                {'id'        : roleId}
                ,function(data){
                    location.reload();
                }
        );

    }
}
</script>

<%
	SessionManager.addContext(GlobalConstants.USERCONTEXT_ROLE);
SessionManager.addContext(GlobalConstants.USERCONTEXT_ROLESLIST);
String roleId = request.getParameter("id");

UserRoleListController roleListController = new UserRoleListController();


ActionScriptParserRoleOpen roleActionScriptParser = new ActionScriptParserRoleOpen();
roleActionScriptParser.setRoleId(roleId);


ActionBarController actionBarController = new ActionBarController();
actionBarController.setActionScriptParser(roleActionScriptParser);
%>


<div>

    <sorokina:ActionBarView datasource="<%=actionBarController %>" />

    <sorokina:TableView datasource="<%=roleListController%>" delegate="<%=roleListController%>" />

</div>